package com.fymxy.question_bank_management.mapper;

import com.fymxy.question_bank_management.pojo.ExamnateKey;
import com.fymxy.question_bank_management.pojo.ExamnateWithBLOBs;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface ExamnateMapper {

    int deleteByPrimaryKey(ExamnateKey key);


    @Insert("insert into examnate (student_no,paper_no,score_record,answer_record,check_status) values " +
            "(#{studentNo},#{paperNo},#{scoreRecord},#{answerRecord},#{checkStatus})")
    int insert(ExamnateWithBLOBs record);

    @Update("update examnate set score_record=#{scoreRecord} where student_no=#{studentNo} and paper_no=#{paperNo}")
    int update(ExamnateWithBLOBs record);

    int insertSelective(ExamnateWithBLOBs record);


    @Select("select student_no,paper_no,score_record,answer_record,check_status from examnate where student_no = #{studentNo} and paper_no = #{paperNo}")
    @Results(id = "examnateMap",value = {
            @Result(column = "student_no",property = "studentNo"),
            @Result(column = "paper_no",property = "paperNo"),
            @Result(column = "score_record",property = "scoreRecord"),
            @Result(column = "answer_record",property = "answerRecord"),
            @Result(column = "check_status",property = "checkStatus")
    })
    ExamnateWithBLOBs selectByPrimaryKey(ExamnateKey key);


    int updateByPrimaryKeySelective(ExamnateWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(ExamnateWithBLOBs record);
}